package com.example.shortvideobackend.repository;

import com.example.shortvideobackend.entity.Like;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface LikeRepository extends JpaRepository<Like, Long> {
    Optional<Like> findByUserIdAndVideoId(Long userId, Long videoId);
    List<Like> findByVideoId(Long videoId);
    List<Like> findByUserId(Long userId);
    long countByVideoId(Long videoId);
    boolean existsByUserIdAndVideoId(Long userId, Long videoId);
} 